<?php
	#########IncludeFiles####################################################################################
	include_once '../inc/config.php';
	include_once("../inc/bootstrape.php");
	require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

	//$name = trim($_GET['type']);
	//$id = trim($_GET['id']);
	
	$name = isset($_REQUEST['type'])?trim($_REQUEST['type']):'';
	$id = isset($_REQUEST['id'])?trim($_REQUEST['id']):'';
	
	$table = isset($_REQUEST['table'])?trim($_REQUEST['table']):'';
	$field = isset($_REQUEST['field'])?trim($_REQUEST['field']):'';
	$field_value = isset($_REQUEST['field_value'])?trim($_REQUEST['field_value']):'';   
     	
    $item_value = isset($_REQUEST['item_value'])?trim($_REQUEST['item_value']):'';
    $item_col = isset($_REQUEST['item_col'])?trim($_REQUEST['item_col']):'';    
    
    $item_id = isset($_REQUEST['item_id'])?trim($_REQUEST['item_id']):'';
    
	switch($name){
		case 'venue_tc_cancellation':
					$res = CommonUtility::getVenueTermsAndCancellationPolicy($id);
					break;
		case 'tc_cancellation':
					$res = CommonUtility::getVendorTermsAndCancellationPolicy($id);
					break;
		case 'similar_venues':
					$res = CommonUtility::getSameCityVenues($id);
					break;
		case 'venue_capacity':
					$res = CommonUtility::getMaxCapacityByVenueId($id);
					break;
		case 'vendor_services':
					$res = CommonUtility::getVendorServicesByVendorId($id);
					break;
		case 'all_services':
					$res = CommonUtility::getAllVendorServices();
					break;
		case 'vendor_venue':
					$res = CommonUtility::getVenuesByVendorId($id);
					//$res = CommonUtility::getVenuesByVendorId();
					break;
		case 'check_availability':
					$res = CommonUtility::checkAvailability($table,$field,$field_value, $item_value, $item_col);
					break;
		case 'service_attribute':
					$row = CommonUtility::getDataById($id, $table='services_master');
                    $subCategoryId = $row['subsubcategory'];
                    $res = CommonUtility::getAttributesByCategoryId($subCategoryId);
                    //$res = CommonUtility::getAttributesByServiceId($id);
					break;
		case 'product_attribute':
                    $row = CommonUtility::getDataById($id, $table='product');
                    $subCategoryId = $row['product_subsubcategory'];
                    $res = CommonUtility::getAttributesByCategoryId($subCategoryId);
					//$res = CommonUtility::getAttributesByProductId($id);
					break;
		case 'subcategory':
					$res = CommonUtility::getSubCategory($id);
					break;
		case 'state':
					$res = CommonUtility::getState($id);
					break;
		case 'city':
					$res = CommonUtility::getCity($id);
					break;
        case 'getattribute':
                    //$res = CommonUtility::getCategoryAttribute($id, $item_id);
                    $subCategoryId = $id;
                    $res = CommonUtility::getAttributesByCategoryId($subCategoryId);                    
                    break;        
        case 'getproductattribute':                    
                    $res = CommonUtility::getProdAttribute($id, $item_id);
                    break;        
        
        default:
					$res = CommonUtility::getCountry($id);
					break;
	}
	echo $res;
?>